package com.hundsun.cprs.yyt.service.common.enums;

import java.util.HashMap;
import java.util.Map;

public enum EnumSmsCode {
    CLINCH_SMS_CODE("600501","成交短信通知"),
    DELIVERY_SMS_CODE("600500","提货短信通知"),
    SELFGET_SMS_CODE("600502","自提短信通知"),
    PART_CLINCH_SMS_CODE("600503","部分成交短信通知"),

    ;
    /** 状态值 */
    private String code;
    /** 状态值说明 */
    private String value;

    private EnumSmsCode(String code, String value) {
        this.code = code;
        this.value = value;
    }

    /**
     * 全局索引池
     */
    private static Map<String, EnumSmsCode> pool = new HashMap<String, EnumSmsCode>();
    static {
        for (EnumSmsCode et : EnumSmsCode.values()) {
            pool.put(et.code + "", et);
        }
    }

    /**
     * 根据内容索引
     *
     * @param code
     * @return
     */
    public static EnumSmsCode indexByValue(String code) {
        return pool.get(code);
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public static Map<String, EnumSmsCode> getPool() {
        return pool;
    }

    public static void setPool(Map<String, EnumSmsCode> pool) {
        EnumSmsCode.pool = pool;
    }
}
